#pragma once

#include<iostream>
#include<string>
#include<ctime>

using namespace std;
string GetCurrTime()
{
    time_t t = time(nullptr);//获取时间戳
    struct tm* curr=localtime(&t); //转为年月日-时分秒
    char currtime[32];
    snprintf(currtime,sizeof(currtime),"%d-%d-%d %d:%d:%d",
            curr->tm_year+1900,
            curr->tm_mon+1,
            curr->tm_mday,
            curr->tm_hour,
            curr->tm_min,
            curr->tm_sec);
    return currtime;
}